<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>统计</title>
    <link rel="stylesheet" href="__PUBLIC__/css/public.css">
    <script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/jquery.SuperSlide.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/d3.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
    <script src="http://code.jquery.com/ui/1.11.0/jquery-ui.min.js"></script>
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
    <link rel="stylesheet" href="http//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
    <link rel="stylesheet" href="">
    <style type="text/css">
    body {
        margin: 10px;
    }
    </style>
    <script type="text/javascript">
    $(function() {

        $("#datepicker-start").datepicker({
            dateFormat: 'yy-mm-dd',
            showButtonPanel: true,

        });



    })

    function getData() {
        var date_value = $("#datepicker-start").val();
        
        var date = new Date();
        if (date_value == '' || date_value == "undefined" || date_value == null) {
          
            alert("请选择日期");
        } else {
            
           
            $.ajax({
                cache: true,
                type: "POST",
                url: "{:U('stat/statMonth')}",
                data: {
                    'type': 0,
                    'date': date_value,
                }, // 你的formid
                async: true,
                error: function(request) {
                    alert("Connection error");
                },
                success: function(data) {

                    fighting.drawRect(data['data'], "month");
                     $("#lmonth").html(data['total']);
                }
            });

             $.ajax({
                cache: true,
                type: "POST",
                url: "{:U('stat/statDianbo')}",
                data: {
                    'type': 1,
                    'date': date_value,
                }, // 你的formid
                async: true,
                error: function(request) {
                    alert("Connection error");
                },
                success: function(data) {

                    fighting.drawRect(data['data'], "dianbo");
                    $("#ldianbo").html(data['total']);
                }
            });
        }



        return false;

    }
    </script>
</head>

<body>
    日期：
    <input type="text" id="datepicker-start" value="{$date}" />
    <input type="submit" value="查找" class="UIbutton" onclick="getData()">
    <br><br>
    包月分布：<label id="lmonth"></label>
    <div id="month" ></div>
    <br>
	<hr/>
	<br>
    点播分布:<label id="ldianbo"></label>
    <div id="dianbo"></div>
</body>

</html>
